package com.example.skin_whitening_ndk;

import android.graphics.Bitmap;

public class Util {
    //把bitmap转化成(jintArray)
    public static  int[] bitmapToArray(Bitmap bitmap)
    {
        int w=bitmap.getWidth(),h=bitmap.getHeight();
        int[] pix = new int[w * h];
        bitmap.getPixels(pix, 0, w, 0, 0, w, h);
        return pix;
    }
    //(jintArray)转化为Bitmap
    public static Bitmap  getJniBitmap(int[] resultInt,int w, int h){
        Bitmap resultImg=Bitmap.createBitmap(w, h, Bitmap.Config.RGB_565);
        resultImg.setPixels(resultInt, 0, w, 0, 0,w, h);
        return resultImg;
    }
}
